<template>
  <div id="book_notice">
    <HomeNoticeHead style="border-radius: 20px"/>
    <div class="notice_box">
<!--      vue中的v-for有三个参数,分别时item,key(即键值),index(索引)-->
      <div v-for="(item,key,index) of noticeList" :key="index">
        <h3>{{key}}</h3>
        <ul>
          <li v-for="(item2,index) of item" :key="index" @click="$router.push('/home/details')">
            <div class="notice_date">{{item2.date}}</div>
            <div class="notice_message">{{item2.title}}</div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import HomeNoticeHead from "../../components/Home/HomeNoticeHead";
export default {
  name: "OnlineAuction",
  components: {HomeNoticeHead},
  data(){
    return{
      noticeList:{
          "2021-11":[
            {title:"图书馆开放",date:"2021-11-18"},
            {title:"图书馆开放",date:"2021-11-18"},
            {title:"图书馆开放",date:"2021-11-18"},
            {title:"图书馆开放",date:"2021-11-18"},
            {title:"图书馆开放",date:"2021-11-18"},
          ],
        "2021-10":[
          {title:"图书馆开放",date:"2021-10-18"},
          {title:"图书馆开放",date:"2021-10-18"},
          {title:"图书馆开放",date:"2021-10-18"},
          {title:"图书馆开放",date:"2021-10-18"},
          {title:"图书馆开放",date:"2021-10-18"},
        ],
        "2021-09":[
          {title:"图书馆开放",date:"2021-09-18"},
          {title:"1231213211",date:"2021-09-18"},
          {title:"图书馆开放",date:"2021-09-18"},
          {title:"图书馆开放",date:"2021-09-18"},
          {title:"图书馆开放",date:"2021-09-18"},
        ]
      }
    }
  },
  methods:{

  }
}
</script>

<style scoped>
#book_notice{

}
.notice_box{
  width: 100%;
  padding: 10px 20px;
}
.notice_box h3{
  line-height: 40px;
  font-size: 23px;
}
.notice_box ul li{
  display: flex;
  width: 970px;
  max-width: 970px;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 10px 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 300ms;
}
.notice_box ul li:hover{
  background: orangered;
  color: #ffffff;
}
.notice_date{
  font-size: 14px;
  font-weight: bold;
  padding: 0 15px;
}
.notice_message{
  font-size: 13px;
  padding-left: 60px;
  border-left: 2px solid #cccccc;
}
</style>
